import Vue from 'vue'
import App from './App.vue'
import router from './router.js'
import axios from 'axios'
import env from '@/env'

axios.defaults.baseURL = env;
axios.defaults.timeout = 8000;
axios.interceptors.response.use(config=>{
  let res = config.data;
  if(res.status == 0){
    return res.data; 
  }else if(res.status == 10){
    window.location.href = '/#/login'
  }else{
    console.error('error');
  }
})

Vue.prototype.axios = axios

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
